export default {
  name: "mes",
  namespaced: true,
  state: {
    GLOBAL_THEME: "light", // 全局主题色
    fullscreen: false, // 是否全屏
    version: "", // 当前版本号
    userInfo: {},
  },
  mutations: {
    changeGlobalTheme: (state, payload) => {
      state.GLOBAL_THEME = payload;
      if (localStorage.getItem("GLOBAL_THEME") !== payload) {
        window.location.reload(); //手动刷新才能生效
      }
      localStorage.setItem("GLOBAL_THEME", payload);
      state.GLOBAL_THEME = payload;
    },
    SetMesUserInfo(state, payload) {
      state.userInfo = payload;
    },
    SetMesFullScreen(state, payload) {
      state.fullscreen = payload;
    },
    SetVersion(state, payload) {
      state.version = payload;
    },
  },
};
